#include "tools.h"

char *convert_to_str(Token token) {
    switch (token.type) {
    case TOKEN_LEFT_PAREN: return "左小括号";
    case TOKEN_RIGHT_PAREN: return "右小括号";
    case TOKEN_LEFT_BRACKET: return "左中括号";
    case TOKEN_RIGHT_BRACKET: return "右中括号";
    case TOKEN_LEFT_BRACE: return "左大括号";
    case TOKEN_RIGHT_BRACE: return "右大括号";
    case TOKEN_COMMA: return "逗号";
    case TOKEN_DOT: return "顿号";
    case TOKEN_SEMICOLON: return "分号";
    case TOKEN_TILDE: return "波浪号";
    case TOKEN_PLUS: return "加号";
    case TOKEN_PLUS_PLUS: return "自增";
    case TOKEN_PLUS_EQUAL: return "加等";
    case TOKEN_MINUS: return "减号";
    case TOKEN_MINUS_MINUS: return "自减";
    case TOKEN_MINUS_EQUAL: return "减等";
    case TOKEN_MINUS_GREATER: return "结构体指针";
    case TOKEN_STAR: return "乘号";
    case TOKEN_STAR_EQUAL: return "乘等";
    case TOKEN_SLASH: return "除号";
    case TOKEN_SLASH_EQUAL: return "除等";
    case TOKEN_PERCENT: return "取模";
    case TOKEN_PERCENT_EQUAL: return "取模等";
    case TOKEN_AMPER: return "按位与";
    case TOKEN_AMPER_EQUAL: return "按位与赋运算符";
    case TOKEN_AMPER_AMPER: return "逻辑与";
    case TOKEN_PIPE: return "按位或";
    case TOKEN_PIPE_EQUAL: return "按位或等";
    case TOKEN_PIPE_PIPE: return "逻辑或";
    case TOKEN_HAT: return "按位异或";
    case TOKEN_HAT_EQUAL: return "HAT_EQUAL";
    case TOKEN_EQUAL: return "EQUAL";
    case TOKEN_EQUAL_EQUAL: return "EQUAL_EQUAL";
    case TOKEN_BANG: return "BANG";
    case TOKEN_BANG_EQUAL: return "BANG_EQUAL";
    case TOKEN_LESS: return "LESS";
    case TOKEN_LESS_EQUAL: return "LESS_EQUAL";
    case TOKEN_LESS_LESS: return "LESS_LESS";
    case TOKEN_GREATER: return "GREATER";
    case TOKEN_GREATER_EQUAL: return "GREATER_EQUAL";
    case TOKEN_GREATER_GREATER: return "GREATER_GREATER";
    case TOKEN_IDENTIFIER: return "IDENTIFIER";
    case TOKEN_CHARACTER: return "CHARACTER";
    case TOKEN_STRING: return "STRING";
    case TOKEN_NUMBER: return "NUMBER";
    case TOKEN_SIGNED: return "SIGNED";
    case TOKEN_UNSIGNED: return "UNSIGNED";
    case TOKEN_CHAR: return "CHAR";
    case TOKEN_SHORT: return "SHORT";
    case TOKEN_INT: return "INT";
    case TOKEN_LONG: return "LONG";
    case TOKEN_FLOAT: return "FLOAT";
    case TOKEN_DOUBLE: return "DOUBLE";
    case TOKEN_STRUCT: return "STRUCT";
    case TOKEN_UNION: return "UNION";
    case TOKEN_ENUM: return "ENUM";
    case TOKEN_VOID: return "VOID";
    case TOKEN_IF: return "IF";
    case TOKEN_ELSE: return "ELSE";
    case TOKEN_SWITCH: return "SWITCH";
    case TOKEN_CASE: return "CASE";
    case TOKEN_DEFAULT: return "DEFAULT";
    case TOKEN_WHILE: return "WHILE";
    case TOKEN_DO: return "DO";
    case TOKEN_FOR: return "FOR";
    case TOKEN_BREAK: return "BREAK";
    case TOKEN_CONTINUE: return "CONTINUE";
    case TOKEN_RETURN: return "RETURN";
    case TOKEN_GOTO: return "GOTO";
    case TOKEN_CONST: return "CONST";
    case TOKEN_SIZEOF: return "SIZEOF";
    case TOKEN_TYPEDEF: return "TYPEDEF";
    case TOKEN_ERROR: return "ERROR";
    case TOKEN_EOF: return "EOF";
    default: return "UNKNOWN";
    }
}
